<?php

class Quad_Spreadsheet_Csv {
	
	protected function _write($fp) {
//Quad_Debug::log($this->_rows, $this->_headings);			
		if (count($this->_rows)) {
			if ($this->_headings) {
				fputcsv($fp, $this->_headings);
			}
			else {
				fputcsv($fp, array_keys($this->_rows[0]));
			}
			foreach ($this->_rows as $r) {
				fputcsv($fp, $r);
			}
		}
		// TODO: return success
	}
		
}